﻿using ITXHWEB.Models;
using ReflectionStudio.Core.Events;
using System;
using System.Data;
using System.Web.Mvc;
using WPFExcelReport;
using WPFExcelReport.Helpers;
using ITXHWEB.Infrastructure;
using System.Collections;
using System.Collections.Generic;
using System.Linq;
namespace ITXHWEB.Controllers
{
    public partial class AMSTAMMController
    {
        [ChildActionOnly]
        public ActionResult SYBJ(string returnUrl)
        {
            ModelState.Clear();
            ViewBag.ReturnUrl = returnUrl;
            ViewBag.IsAMReady = MABF.IsAMReady;
            if (!MABF.IsAMReady)
            {
                INFO = "请扫描有效的设备";
            }
            return PartialView(MABF.MAM);
        }
        [HttpPost]
        [AllowAnonymous]
        [ValidateAntiForgeryToken]
        public ActionResult SYBJ(AMSTAMMModel model, string returnUrl)
        {
            try
            {
                ModelState.Clear();
                ViewBag.IsAMReady = MABF.IsAMReady;
                model.SHIFT = "1";
                AMCHK(model);
            }
            catch (Exception ex)
            {
                INFO = ex.Message;
                Tracer.Error(ex.StackTrace, ex);
            }
            return RedirectToAction(MAPP, MAPP);
        } 
    }
}
